<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:74:"/Users/qingyun/php/fruits/public/../application/admin/view/order_index.tpl";i:1514703828;}*/ ?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>订单管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 订单管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
        <span class="r">共有数据：<strong><?php echo $count; ?></strong> 条
        </span>
    <div class="mt-20">
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="100">订单编号</th>
                <th width="80">收件人</th>
                <th width="100">联系电话</th>
                <th width="">收件人地址</th>
                <th width="50">订单金额</th>
                <th width="150">添加时间</th>
                <th width="80">订单状态</th>
                <th width="120">操作</th>
            </tr>
            </thead>
            <tbody id="content">
            <?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): if( count($data)==0 ) : echo "" ;else: foreach($data as $key=>$vo): ?>
                <tr class="text-c">
                    <td><?php echo $vo['number']; ?></td>
                    <td><?php echo $vo['name']; ?></td>
                    <td><?php echo $vo['tel']; ?></td>
                    <td><?php echo $vo['address']; ?></td>
                    <td><?php echo $vo['total']; ?>元</td>
                    <td><?php echo $vo['addTime']; ?></td>
                    <td class="td-status">
                        <span class="label label-success radius"><?php if(($vo['status'] == 1)): ?> 待付款<?php elseif(($vo['status'] == 2)): ?> 已付款<?php elseif(($vo['status'] == 3)): ?> 已发货<?php elseif(($vo['status'] == 4)): ?> 已签收<?php elseif(($vo['status'] == 5)): ?>已评价<?php else: ?>订单完成<?php endif; ?></span>
                    </td>
                    <td class="f-14 td-manage">
                        <a style="text-decoration:none" onclick="status(<?php echo $vo['id']; ?>,<?php echo $vo['status']; ?>)" href="javascript:;" title="<?php if(($vo['status'] == 2)): ?>发货<?php endif; ?>"><?php if(($vo['status'] == 2)): ?>发货<?php elseif(($vo['status'] == 5)): ?>订单完成<?php endif; ?></a>

                        <a href="<?php echo url('admin/Order/lists'); ?>?id=<?php echo $vo['id']; ?>">订单详情</a>
                    </td>
                </tr>
            <?php endforeach; endif; else: echo "" ;endif; ?>

            </tbody>
        </table>
        <div id="page" style="float: right;"></div>
    </div>
</div>




<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript" src="/static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript">
    laypage({
        cont: 'page',//分页容器的id
        pages: <?php echo $pages; ?>, //总页数
        curr:<?php echo $page; ?>, //当前页
        jump:function(e,first){
            if(!first){
                location.href = '<?php echo url("admin/Order/index"); ?>?page='+e.curr;
            }
        }
    });
    // 订单状态
    function status(id,status){
        if(status == 2){
            var str = '确认客户已付款了吗?';
        }
        if(status == 5){
            var str = '确认客户已评价了吗?';
        }
        layer.confirm(str,function(index){
            $.post('<?php echo url("admin/Order/status"); ?>',{id:id,status:status},function (data) {
                if(data.status > 0){
                    window.location.reload();
                }
            })
        })
    }
</script>
</body>
</html>